package com.weixing.mall.pay.util;

import com.thoughtworks.xstream.XStream;

/**
 * @ClassName XmlUtil
 * @Description xml工具类
 * @Author Small
 * @Date 2019/12/4 10:50
 * @Version 1.0
 **/
public class XmlUtil {

    public static Object xmlStr2Bean(String xmlStr,String alias,Class clazz){
        XStream xstream = new XStream();
        xstream.alias(alias,clazz);
        xstream.ignoreUnknownElements();
        xstream.processAnnotations(clazz);
        Object o = xstream.fromXML(xmlStr);
        return o;
    }
}
